package com.example.api;


import com.example.api.domain.JudgeResult;
import com.example.api.domain.JudgeSubmitDTO;
import com.example.api.factory.RemoteJudgeFallbackFactory;
import com.example.core.constants.SecurityConstants;
import com.example.core.constants.ServiceNameConstants;
import com.example.core.domain.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

@FeignClient(contextId = "RemoteJudgeService", value = ServiceNameConstants.JUDGE_SERVICE, fallbackFactory = RemoteJudgeFallbackFactory.class)
public interface RemoteJudgeService {

    @PostMapping("/judge/doJudge")
    R<JudgeResult> doJudge(@RequestBody JudgeSubmitDTO judgeSubmitDTO, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
